package com.project.controller.LogController;

import com.github.pagehelper.PageInfo;
import com.project.bean.LogBean;
import com.project.service.LogService.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("log")
public class LogController {
    @Autowired
    private ILogService service;

    @RequestMapping("add")
    public String add(LogBean log){
        service.add(log);
        return "ok";
    }

    @RequestMapping("findByItem")
    public PageInfo<LogBean> findByItem(int pageNO,LocalDate startDate,LocalDate endDate){
        return service.findByItem(pageNO, startDate, endDate);
    }

}
